home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 4 / Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso / Newton / Development / newt-devenv-22 Folder / NewtNews.txt < prev   
Text File  |  1994-06-03  |  34KB  |  691 lines

  1. NewtNews.txt
  2. S. Weyer
  3.  
  4. note: the text in this file has no substantive changes since the version
  5. for Newt 2.1.  a few names, numbers and typos have been fixed.  see Newt.1st
  6. (and change22.txt for registered users) for other information.
  7.  
  8. About Newt 2.2
  9. a native environment for developing simple applications using NewtonScript, and
  10. creating turtle-like graphics using gestures, buttons, and NS.
  11.  
  12. Keywords: object-oriented programming, application development environment,
  13. NewtonScript, NTK, learning, graphics, mathematics, Logo.
  14.  
  15. Copyright S. Weyer 1993, 1994, All Rights Reserved.
  16.  
  17. Newt is shareware. It may be freely distributed via online services and
  18. bulletin boards if it is unmodified and includes the file NewtNews.txt. It may
  19. not be commercially bundled or redistributed on CD-ROM, floppy disk, PCMCIA,
  20. networks or other media without my permission. Please continue reading for
  21. help, examples, warnings and other information.
  22.  
  23. After several days of trial use, please register your copy by sending a check
  24. ($30 before 8/1/94; -- see Shareware and Freeware) to the author. Tap overview,
  25. select About Newt, tap Save to save a Registration Form in Notepad. In return,
  26. I will provide you with a 40+ page manual containing additional features and a
  27. mini-tutorial on NewtonScript, source for additional modules/examples, and
  28. priority in responding to requests.
  29.  
  30. Stephen Weyer
  31. 17 Timber Knoll Drive
  32. Washington Crossing, PA 18977-1052
  33. Internet: weyer@guest.apple.com
  34. America Online/eWorld/NewtonMail: SteveWeyer
  35. AppleLink: WEYER.S
  36.  
  37. Revision History
  38. 2.2 (6/6/94):
  39. + support and examples for additional system prototypes and viewclasses
  40.   (it now supports all prototypes and viewclasses described in NTK 1.0.1):
  41.   protoRCheckbox, protoFilingButton, protoDrawer, protoDateExpando,
  42.   protoPhoneExpando, protoActionButton, protoPrintFormat, protoKeyboard,
  43.   protoKeypad, protoLabeledBatteryGauge, protoPicker, protoEndPoint,
  44.   clView, clEditView, clGaugeView, clKeyboardView, clMonthView, clOutline,
  45.   clParagraphView, clPictureView, clPolygonView, clRemoteView
  46. + a few other fixes/features (described in change22.txt for registered users)
  47.  
  48. 2.1 (4/20/94):
  49. + reorganizes interface: Edit Methods moves to "main" view, turtle to Drawing
  50.   Area; other cosmetic improvements
  51. + supports and documents additional system prototypes: protoBorder,
  52.   protoCloseBox, protoDivider, protoFloater, protoFolderTab, protoGauge,
  53.   protoGlance, protoLabelInputLine, protoLargeCloseBox, protoPictIndexer,
  54.   protoPictRadioButton, protoPictureButton, protoRoll, protoRollBrowser,
  55.   protoRollItem, protoSetClock, protoShowBar, protoStatus, protoStatusBar,
  56.   protoTable, protoTableDef, protoTableEntry, protoTitle
  57. + supports user prototypes and subviews ("linked layouts")
  58. + handles low frame heap situations better
  59. + adds Color (penPattern) option for Newt drawing
  60.  
  61. 2.0 (2/16/94):
  62. + adds initial support for creating interface objects and saving applications
  63. + new icon; "auto close"; separate RUNewt application for running, exchanging
  64.   applications
  65. + rearranges/resizes interface for Newt Controls, Eval Controls, Code
  66.   Templates, Edit Methods (continued)
  67. + moves samples to Expr button, overview accesses list of views
  68. + sets keyboard input to a default edit location (Eval field or method source)
  69. + saves folder for "newts" to/from Preferences; does not remove Preferences as in 1.1
  70. + improves access for large and larger numbers of method entries
  71. + adds visual feedback for Pen setting -- Newt grows/shrinks
  72. + adds support for Logo word and sentence operations
  73.  
  74. 1.2 (12/93-2/94)
  75. + limited distribution beta releases; Happy Newt Year
  76.  
  77. 1.1 (11/24/93):
  78. + saves Newt methods, screen snapshots and evaluation results as "newts"
  79.   (notes) in Notepad, organized via the built-in folders
  80. + sends messages to single newt or to many newts
  81. + adds a Print?option, with results and errors printed to a popup scrolling Eval Log
  82. + eliminates the "do you want to add..." prompts during keyboard entry
  83. + streamlines NewtonScript editing via inserting code templates in Edit
  84.   Methods (continued) and via selecting entire sample expressions for Eval field
  85. + recognizes line gesture to set Newt heading and to draw lines; drag to move Newt
  86. + draws more cleanly (clipping, refresh); adds "poof" animation for erase
  87. + simplifies interface for editing methods; scrolls methods
  88. + traps and reports errors
  89. + removes Preferences entry when Newt application is removed
  90.  
  91. 1.0 (10/12/93)
  92. + initial release
  93.  
  94.  
  95. Introduction
  96.  
  97. Learners or Programmers?
  98. You can use Newt as
  99. + a pen-based "etch-a-sketch"
  100. + a Logo-like turtle-graphics environment
  101. + an introduction to NewtonScript and object-oriented programming
  102. + a construction tool for simple views and applications
  103. You can get started by trying some of the simple examples outlined under Quick Tour.
  104.  
  105. Newt and Turtle
  106. "Newton Turtle" and "NewtTurtle" seemed a bit too long, so I shortened its name
  107. to Newt, given its amphibious similarity to its Logo cousin and also its
  108. non-turtle uses. So that Newt can appeal to many families and orientations, it
  109. is gender "newtral" (in order to reproduce more Newts, however, it has not
  110. been "newtered"); users should probably not call themselves "newtists".
  111.  
  112. Newt and Newton
  113. "Newt" is often used by the monosyllable-challenged to refer to a Newton. "Newt
  114. is neat" could refer to the Newton itself and/or to this wonderful application
  115. -- I will always mean the latter. Show Newt to your friends to help achieve
  116. the worldwide goal of "Newt on every Newt"!
  117.  
  118. Newt and Notepad
  119. Another name for Newt could have been "NewtPad" given its use of the Notepad
  120. application for viewing, printing, etc. of "newt notes" (methods and screens)
  121. or "newts" for short. One might imagine a future Newt as just a smart drawing
  122. button available on the standard Notepad. In the meanwhile, Newt is a separate
  123. application.
  124.  
  125. NewtonScript (NS) and Logo
  126. In addition to using buttons and gestures, you can command Newt and build
  127. application objects via NewtonScript (NS), which is Newton's built-in,
  128. object-oriented (o-o) language. NS shares ancestry with dynamic o-o languages
  129. like Smalltalk, Self, Common Lisp, and ObjectLogo. For more advanced users,
  130. familiarity with o-o concepts and constructs would be useful; for others, Newt
  131. should serve as a brief introduction to these ideas. For exploration of Newt's
  132. "turtle personality", familiarity with Logo concepts and turtles would be
  133. useful though not necessary. Although Newt does not "understand" any of the
  134. Logo dialects directly, it does provide turtle commands, and an optional
  135. module for manipulating Logo-style data structures, i.e., words and sentences.
  136. Despite syntactic differences with Logo, you can borrow ideas and translate
  137. code from Logo materials and books, e.g., Abelson & diSessa, books on
  138. fractals, etc.
  139.  
  140. Newt in the News
  141. Newt 1.0 received a positive review in the first issue of the (now defunct)
  142. DoubleTap newsletter. Drafts of two articles are available via email:
  143. exploring graphics via Newt's "turtle personality", and building applications
  144. via Newt's application personality. Given the dynamic nature of the PDA
  145. publication marketplace, it's unclear where and when these will appear.
  146. _protoReality 1.3 -- the NANUG newsletter, available as a Newton book --
  147. features an interview about Newt.
  148.  
  149. In other literary references, there is of course Shakespeare's famous drink
  150. recipe: "eye of newt, ...". Tabloids will probably suggest a connection
  151. between Newt and Elvis. This is likely, given Elvis' early career as a "lounge
  152. lizard". To see proof of this (and ensure the proper mood for using Newt), you
  153. can set the Country field of your Personal Preferences to Graceland (warning:
  154. this "Easter Egg" may later interfere with dialing). A picture of a newt will
  155. reappear briefly whenever you wakeup your Newton (this seems to have gone away
  156. in the newest Newton ROMs; other wakeup pictures can be obtained by adding two
  157. or three spaces after your Address). You should discount any allegations
  158. suggesting any relation between Newt and Senator Newt Gingrich or football
  159. great Knute Rockne. Finally, for crossword puzzle fans, "eft" is an old term
  160. for "newt".
  161.  
  162. Newt and RUNewt and Newton ToolKit (NTK)
  163. Newt allows you to write your own expressions and methods, and execute them
  164. directly on your Newton. Newt 2.0 introduced rudimentary capabilities to
  165. create dynamic views and stand-alone applications that can later be run or
  166. transferred using RUNewt -- for further information, see RUNewt.txt. Users
  167. interested in building small applications could consider Newt a portable
  168. prototyper, or as a learning step toward building more complex, complete and
  169. industrial-strength applications via Apple's desktop-based Newton ToolKit
  170. (NTK). Since I provide little description of Newton syntax, other functions,
  171. or curriculum ideas in this introductory file, I strongly recommend that you
  172. stay reasonably close to the examples that I provide, register Newt to obtain
  173. a more detailed manual and sample sources, wait for NS books to be published,
  174. and/or buy the NTK and docs from APDA for $795. I also recommend PIE
  175. Developers magazine.
  176.  
  177. Programming WARNING -- Newt and You
  178. Exploring "mathematics microworlds" and doing problem solving by writing
  179. programs are "powerful ideas" (Seymour Papert) and require some active
  180. participation by you the learner -- taking risks and making mistakes. For
  181. example, Newt allows you to execute arbitrary NewtonScript expressions. This
  182. can be a formula for enlightenment or disaster. So, remember that this is your
  183. Newton with your information and listen to your mother's advice about backing
  184. up your system and hanging out with strange functions.
  185.  
  186. Using common sense in following examples and suggestions, and limiting yourself
  187. to documented commands, you should reap many benefits and long hours of
  188. enjoyment from using Newt. At the same time, "a little learning [about
  189. programming] is a dangerous thing" (with apologies to Alexander Pope). I would
  190. caution against experimenting with random functions or methods. "Gee, I wonder
  191. what xxx does" might yield a simple error box, or it might zap a frame or soup
  192. in your system.
  193.  
  194. At the same time, given the litigious nature of our society that yearns for
  195. risk without responsibility, I feel compelled to add the following warning
  196. (repeated in other variations several places later): >>> WARNING: USE THIS
  197. PACKAGE AT YOUR OWN RISK! <<<
  198.  
  199. Shareware and Freeware
  200. Newt is my first shareware offering; earlier, I distributed a freeware game
  201. "PicoFermiBagels". I debated whether to cripple this version by not allowing
  202. you to save any or many methods or to automatically quit after awhile if you
  203. hadn't registered, but I decided that I'd rather spend my time figuring out
  204. how to add new functionality rather than disable existing features.
  205.  
  206. Registered users receive a formatted manual including information about
  207. additional methods, an introduction to NewtonScript, and selected source
  208. examples. I welcome comments, suggestions and questions; I will respond as
  209. time permits. Minor updates to the basic Newt package will generally be
  210. free, especially if distributed over a network. However, I reserve the right
  211. to charge additionally for major upgrades, for additional modules or other
  212. services. The registration fee for Newt 2.2 is currently $30 (until 8/1/94)
  213. -- "$35" for international users to cover currency fluctuation and
  214. additional mailing cost. Checks preferred (no Visa yet). Current registered
  215. users can request the latest manual for $5, a Mac or PC floppy with latest
  216. release and examples for $5.
  217.  
  218. RUNewt is free to end-users; if you like it, I ask that you send email to my
  219. kids (America Online: Krisbo and EllieJelly; internet: EllieJelly@aol.com,
  220. Krisbo@aol.com), postcards, and/or other valuable tokens of appreciation.
  221. Developers can contact me about invoking RUNewt from their applications, and
  222. bundling the latest (or custom version) of RUNewt with their applications --
  223. all for a small flat licensing fee. See RUNewt.txt for further info.
  224.  
  225. If after a few days of trial use, you find Newt useful and would like to
  226. continue using it with a clear conscience and have the additional benefits
  227. just mentioned, please stop procrastinating and register. I know this sounds
  228. like a pledge break for National Public Television/Radio, but that's the kind
  229. of user participation and support that shareware deserves and needs. If you're
  230. still not ready to register, don't be afraid to send email -- to ask more
  231. about what Newt already provides or tell me what it should have. Knowing users
  232. are out there, with some occasional words of encouragement and praise, are
  233. important. Money confirms that, covers some costs, and helps justify spending
  234. a little more time on Newt in preference to other family or business pursuits.
  235. To register, tap overview, select About Newt, then tap Save (in Eval Controls)
  236. before exiting to create a registration form in your Notepad to print, email,
  237. etc.
  238.  
  239. Where to Find Newt and RUNewt
  240. Presumably, you have already obtained Newt or you would not be reading this. A
  241. compressed file usually named newt-devenv-vv.sit or .hqx (vv = version number,
  242. e.g., 2.2 = 22) should contain Newt-vv.pkg and NewtNews.txt; runewt-vv.sit or
  243. .hqx should contain RUNewtvv.pkg and RUNewt.txt. You should find the most
  244. recent versions on:
  245.  
  246. America Online(AOL): PDA:New Files (or PDA:Software Libraries:Newton)
  247. Internet via anonymous ftp:
  248.    + newton.uiowa.edu:pub/newton/software/app/
  249.    + sumex-aim.stanford.edu(&mirror sites):info-mac/newton/app/
  250. AppleLink: Newton:Newton User Discussions:Freeware, Shareware and Demos
  251. Compuserve: GO NEWTON (DL 8)
  252. Other: let me know where else you obtain it so that I can ensure that it is
  253. current and complete.
  254.  
  255. Installation
  256. I assume that
  257. + your online service (e.g., AOL, Compuserve) handles automatic file unpacking/
  258.   conversion (or you are familiar with Binhex and Stuffit tools on PC or Mac)
  259. + you have a serial cable and Newton Connection Kit (NCK) or Package Express
  260.   for Macintosh or Windows, or the freeware Newton Package Downloader for Mac
  261. If not, contact me and I may be able to offer some help.
  262.  
  263.  
  264.  
  265. Newt Interface Guide
  266.  
  267. Quick Tour
  268. Once you have installed and started Newt:
  269. + tap overview and select About Newt. You can tap Save (located in the bottom
  270.   Eval Controls) to save a registration form to your Notepad. close About Newt.
  271. + to explore Newt's turtle personality, tap overview and select Newt Drawing,
  272.   then select Newt Controls.
  273. + write a number into the input field to the right of Dist, e.g., 80. tap Dist.
  274. + write a number into the input field to the right of Deg, e.g., 90. tap Deg.
  275. + write a (small) number, e.g., 4, into the input field to the right of Times.
  276.   tap Times.
  277. + tap Newt? checkbox. tap it again.
  278. + tap Erase. tap Home.
  279. + tap Expr and select an expression. maybe edit values for times, dist, deg.
  280.   tap Eval button.
  281. + draw a picture that you like, tap Save (later check that folder in Notepad).
  282. + drag Newt to another location and Eval an expression again.
  283. + select and Eval :fourNewts() from the Expr list, then select and Eval
  284.   another expression like :squiral(8,40)-- this demonstrates broadcasting
  285.   messages to multiple Newts. Use a gesture on a specific newt. Send a message
  286.   to the upper left newt, e.g., newt1:poly2(5,40,144,0)
  287. + to explore Newt's application personality, select and Eval :helloDemo0()
  288.   from the Expr list. This is a trivial example of an application. You can
  289.   write a number in the input field, tap on the About button, or evaluate an
  290.   expression such as SetValue(hello.text1, 'text, "hello"),
  291.   hello.button1:hide() or hello.button1:show(). If you have installed RUNewt,
  292.   you can tap the Save button in Eval Controls when Hello Demo is on top, and
  293.   then run or transfer your app later -- see RUNewt.txt for further info. To
  294.   find out more about building applications in Newt, send me email for a copy
  295.   of a draft article, or better yet, register to receive the manual and more
  296.   examples.
  297.   
  298. The following sections cover the major interface areas of Newt -- the views
  299. available by tapping overview (the dot between the two fixed scroll arrows at
  300. the bottom of the screen).
  301.  
  302. Edit Methods (Main View)
  303. This is the initial screen where you browse and edit object methods. Other
  304. views (windows) are used for drawing, printing, building applications, and as
  305. control palettes.
  306.  
  307. overview
  308. Tapping the overview dot (between the fixed scroll arrows) pops up a list of
  309. current views, containing built-in views such as About Newt, Newt Drawing and
  310. Eval Log, palettes such as Code Templates, Eval Controls or Newt Controls,
  311. RUNewt 2.2 (if installed), and any user-created applications, e.g., Hello
  312. World.
  313.  
  314. scroll arrows
  315. In Edit Methods (Main View) or Eval Log (if visible), the main text field
  316. scrolls.
  317.  
  318. folder tab
  319. Newt uses the folder label for organizing "newts" for Save in Edit Methods
  320. (Main View), Newt Drawing, , Eval Log, and About Newt. Newt does not currently
  321. provide a filing button or action button; however, you can look at,
  322. reorganize, print, fax, beam etc. your saved newts (methods, screen snapshots,
  323. print results, registration form) outside Newt in the Notepad application.
  324. Newt "compiles" (i.e., makes an executable version of) methods found in the
  325. current folder, and notes errors (if any) in Eval Log.
  326.  
  327. We will now cover the other palettes and views, and return to editing and
  328. creating methods later under Edit Methods (continued).
  329.  
  330. Eval Controls
  331. The following controls are found in a floating, draggable palette, located
  332. initially at the bottom of Newt's screen: Eval field, Expr, keyboard icon,
  333. Eval button, Print?, and Save. As a general rule, you will want to keep Eval
  334. Controls always visible, rather than closing and re-opening it.
  335.  
  336. Eval field
  337. This field can contain a short program in NewtonScript. Tap the Eval button to
  338. execute it. Techniques for entering expressions include combinations of
  339. + handwriting -- not great, given the amount of punctuation needed
  340. + copy & drag text selections to/from the margin "clipboard"
  341. + tap the keyboard icon for a floating keyboard without "do you want to add" prompts
  342. + double-tap for the default alphanumeric keyboard and use extra spaces
  343.   around NewtonScript punctuation to prevent spurious prompts
  344. + keyboards, e.g., KbdPro, or "reverse terminal emulators", e.g., Typomatica
  345.   (Figgles Utils)
  346. + tapping Times in Newt Controls to fill in a standard for expression
  347. + selecting complete expressions from the Expr list
  348. + using the variable names times, dist and deg, so you can change numbers in
  349.   the Times, Dist and Deg fields in Newt Controls rather than in the middle of
  350.   the Eval field.
  351. + selecting partial expressions from the Code Templates palette
  352.  
  353. Expr
  354. A popup list of sample expressions appears. If you select an expression, it
  355. appears in the Eval field. You can then edit it, and/or tap the Eval button to
  356. execute. Registered users can customize this list.
  357.  
  358. keyboard icon
  359. This toggles (either shows or hides) a floating alphanumeric keyboard that does
  360. not prompt for additions to the dictionary. You can double-tap in the Eval
  361. field for the standard keyboard.
  362.  
  363. Eval button
  364. Tap the Eval button to evaluate (compile and execute) the expression in Eval
  365. field. The button remains highlighted during execution. During interruptible
  366. methods, e.g., squiral2, it changes to Stop and you can tap it to terminate
  367. execution. If you spell something incorrectly, or use incorrect parameters or
  368. syntax, Eval Log (or a system error box) will appear with a somewhat cryptic
  369. error message or code. Basically, you'll have to take a closer look at what
  370. you wrote, take a look at the additional NewtonScript documentation (see
  371. NewtonScript) or error codes (see Errors), edit it and try again.
  372.  
  373. WARNING: I DO NOT PROVIDE A GENERAL INTERRUPT CAPABILITY. SO, UNLESS YOU LIKE
  374. USING THE MANUAL RESET BUTTON IN THE BACK, USE COMMON SENSE IN CHOOSING VALUES
  375. FOR ITERATION, RECURSION OR DISTANCE THAT ARE NOT "TOO LARGE". I will
  376. generally provide some reasonable values to try. Newt's default behavior is to
  377. finish executing the entire expression before checking for user actions like
  378. button taps. There is a facility provided in Newt to replace the NewtonScript
  379. for iteration construct. This facility executes each step in the background,
  380. allows you to interrupt Newt, and is covered in the manual.
  381.  
  382. Print?
  383. If checked (default: no), the Eval Log view pops up with expression and results
  384. after you tap the Eval button. Error messages will also appear regardless of
  385. this setting.
  386.  
  387. Save
  388. The current (top) view is saved, usually to the Notepad under the current
  389. folder tab category. For Edit Methods (Main View), the method source, if
  390. edited, is saved. For About Newt, a text registration form is saved. For Eval
  391. Log, the current printed results are saved. For Newt Drawing, the current
  392. drawing, if any, is saved . A user Application is saved to an application
  393. soup, if RUNewt is installed. If the view is not recognized, Newt beeps.
  394.  
  395. Newt Drawing
  396. Newt's drawing area appears when you select it from overview, use Newt
  397. Controls, or evaluate an expression using drawing methods. You can use the
  398. following gestures to operate on the Newt closest to the start of the gesture.
  399. (You may have multiple Newts -- see :fourNewts() expression).
  400. + tap
  401. Newt moves to location of pen using current Pen setting, preserving heading.
  402. + line
  403. Newt sets heading to orientation (mod 45 degrees) of line. If Newt is already
  404. headed in that direction, it draws a line of same length (rounded to mod 10)
  405. of your gesture.
  406. + scrub
  407. same as Erase
  408. + drag
  409. Hold down on a Newt until you "hear a squeak and get a fat pen" (actually the
  410. "hilite" gesture). Then, drag to a new location before lifting pen. Newt moves
  411. to new location without drawing.
  412.  
  413. Use the Save button in Eval Controls to save the current drawing in the Notepad
  414. under the current folder tab category. Newt currently "remembers" the current
  415. drawing when you close and re-enter Newt Drawing.
  416.  
  417. Newt Controls
  418. Select this floating, draggable palette via overview. It is located initially at
  419. the top of Newt Drawing. and contains the following controls: Erase, Home,
  420. Pen, Color, Newt?, Times button & field, Dist button & field, Deg button &
  421. field. Like keyboards and Eval Controls, it can be dragged by its bottom
  422. border.
  423.  
  424. Times
  425. The value in this field (default: 0) can be used as a times variable in the
  426. Eval field. The Times button uses this value to create an iteration, e.g., if
  427. Times=4, Dist=40, Deg=90, tapping on Times tells Newt to :go(40) then
  428. :turn(90) 4 times, i.e., making a square -- the NewtonScript is written to the
  429. Eval field where it is executed immediately (and you can edit it later if you
  430. like). Tap Deg to turn, then tap Times or the Eval button again to see what
  431. happens.
  432.  
  433. Dist
  434. The value in this field (default: 0) can be used as a dist variable in the Eval
  435. field. The Dist button uses this value for distance, e.g., if Dist=20, tapping
  436. on Dist tells Newt to :go(20), moving 20 in the "forward" direction, i.e.,
  437. along Newt's current heading. This draws a line if Pen is non-zero. A negative
  438. value for dist just means go "backward". To give you some idea of scale,
  439. Newt's default drawing area on MessagePad is roughly 228x310 (on a MP100).
  440. Newt clips at its drawing boundary.
  441.  
  442. Deg
  443. The value in this field (default: 0) can be used as a deg variable in the Eval
  444. field. The Deg button uses this value for degrees, e.g., if Deg=90, tapping on
  445. Deg tells Newt to :turn(90), turning right (clockwise) by 90 degrees. A
  446. negative value just means turn left. Newt will "mod" your number to prevent
  447. dizziness.
  448.  
  449. Erase
  450. Newt erases drawing area, and remains with same position, heading and pen.
  451.  
  452. Home
  453. Newt teleports to center, sets heading to 0 ("up"), preserving pen setting but
  454. without drawing.
  455.  
  456. Pen
  457. Newt sets pen thickness used in drawing (default: 1) and grows or shrinks in
  458. size. 0 means Newt just moves (no line)
  459.  
  460. Color
  461. Newt sets pen pattern used in drawing (default: black). Currently, this color
  462. is not available in saved Notepad drawings (everything is black).
  463.  
  464. Newt?
  465. If checked (default: yes), Newt appears with its tip at current x,y position,
  466. pointing in current direction, and "xor-ed" so that it does not interfere with
  467. drawing.
  468.  
  469. About Newt
  470. Select this via overview. Tap Save in Eval Controls to create a registration
  471. form in Notepad under the current category (see folder tab) for later
  472. printing, mailing, etc.
  473.  
  474. Code Templates
  475. This is a separate floating, draggable palette accessible via overview, located
  476. initially on the right hand side of the screen. This can be used for Eval
  477. field, but is most useful for method source in Edit Methods (Main View). As
  478. you select items from the text list, a template is inserted into your current
  479. method. Customizing this list is described in the manual.
  480.  
  481. Eval Log
  482. See earlier comments under folder tab, scroll arrows, Print? and Save.
  483.  
  484. RUNewt 2.2
  485. If you have RUNewt installed on your Newton, it will appear in overview, where
  486. you can select it in order to run earlier Newt-created applications -- see
  487. RUNewt.txt for further info.
  488.  
  489. Your Applications
  490. overview also contains the titles of applications you are currently developing
  491. within Newt, based on source methods. Once you Save the application as a frame
  492. object, it is available separately via RUNewt.
  493.  
  494.  
  495. Edit Methods (continued)
  496. We now complete coverage of the interface by returning toEdit Methods (Main
  497. View).
  498.  
  499. method names
  500. A "picker" at the top preceded by a diamond contains methods defined in current
  501. folder (see folder tab). You can also select New at the top of the menu to
  502. create a default template.
  503.  
  504. method source
  505. Like the Eval field, you can use handwriting, copy & drag and keyboards to edit
  506. your method. In addition, you can copy an entire existing method by changing
  507. its name. The only format requirement is that the method name occur on the
  508. first line, and be followed immediately on the next line by func.
  509.  
  510. For example, here is source for your own implementation of mypoly:
  511. mypoly
  512. func (nsides,len)
  513. // make a polygon of <nsides>
  514. // each side is <len> length
  515. // this computes angle <ang>
  516. if nsides=0
  517. then :beep ()
  518. else begin
  519.     local i,ang := 360/nsides;
  520.     for i:=1 to nsides
  521.     do begin
  522.         :go (len); :turn (ang);
  523.     end;
  524. end
  525.  
  526. You could then invoke this method in the Eval field, e.g., :mypoly(5,75). Or, a
  527. method can be as simple as:
  528. fd
  529. func(distance)
  530. // forward
  531. :go(distance)
  532.  
  533. Revert
  534. If you have unsaved changes, the Revert button appears. Tap it to return to the
  535. last version saved of the original method, or for New, to the basic template.
  536.  
  537. Save
  538. Assuming that the method name is valid, does not conflict with a pre-defined
  539. "system" method, and successfully compiles, the method source is saved
  540. (created or updated) as a "newt" (i.e., text Note) in the current folder.
  541. Errors, if any, are noted in Eval Log. Newt saves only valid sources. So, if
  542. you cannot figure out a compile error from the cryptic message, you could
  543. either Revert to the earlier version, or comment out offending code (precede
  544. individual lines with //, or wrap a section with /* <lines of code> */), so
  545. that you can Save for now, get on with your life, and look at it later.
  546.  
  547. Preferences
  548. Newt saves your preferences for Pen, Color, Newt?, Print? and folder tab
  549. category in a small "system soup" frame so that these persist across Newt
  550. sessions. Should you no longer need Newt, you can remove this preferences
  551. frame via a soup utility.
  552.  
  553. NewtonScript
  554. Syntax
  555. If you have already tried out the examples outlined in the earlier Interface
  556. Quick Tour, tapped on the example expressions under Expr, and looked at the
  557. earlier mypoly example, then you should have a rough idea of what the
  558. NewtonScript (NS) syntax is like and several of Newt's commands. In NS,
  559. programs or scripts are defined as "methods" on objects. Methods describe an
  560. object's behavior or actions. Objects in NS are called "frames" (perhaps they
  561. should have been called "newtrons"), which "inherit" attributes and behavior
  562. from other frames, usually called "prototypes". Newt is a prototype or kind of
  563. view. You tell Newt to do things by sending it a "message", e.g., go. This
  564. message consists of a frame (Newt implicitly), a colon (:) separator, the
  565. method name, and parentheses with zero or more parameters (values for
  566. variables) separated by commas. For example, :go(50). A frame also has "slots"
  567. (named attributes) that contain values that you can access, such as times,
  568. dist, and deg. You can just use the slot name if it can be found via
  569. inheritance, or frame.slot if you want to be more specific.
  570.  
  571. WARNING: IF YOU USE OTHER SYSTEM FRAMES, METHODS, AND FUNCTIONS BEYOND THE ONES
  572. I HAVE DESCRIBED HERE AND IN EXAMPLE FILES, YOU DO SO AT YOUR OWN RISK.
  573.  
  574. For further information on NewtonScript syntax and view frame slots and
  575. methods, NTK from APDA includes manuals, and other books will be published.
  576. The Newt Manual provides a brief summary of syntax and functions, along with
  577. additional Newt methods for registered users.
  578.  
  579. Errors
  580. In the unlikely event that a system box pops up with a cryptic error code
  581. during Eval or Save, check the following partial list of common error codes,
  582. and see if there might be something missing or extra in one of your values or
  583. expressions.
  584.  
  585. Table 1: Common Error Codes
  586. Code
  587. Description
  588. -8007
  589. syntax error (from compiler)
  590. -48404
  591. expected a number
  592. -48402
  593. expected an integer
  594. -48803
  595. wrong number of arguments
  596. -48807
  597. undefined variable
  598. -48809
  599. undefined method
  600. 1627052
  601. divide by zero
  602.  
  603. There is a Newton book (newton.uiowa.edu/newton/software/books/error-book.hqx)
  604. that lists errors from the NTK docs. If you have a Macintosh, the Newton
  605. LowDown DA (newton.uiowa.edu/newton/misc/lowdown-da.hqx) may be useful.
  606.  
  607. Things to try: check your syntax against those in examples, check spelling for
  608. method and variable names, missing or extra punctuation, garbage from stray
  609. gestures, check number and type of arguments (e.g., float vs. integer), and in
  610. general use your "newtle". If you think it's really a problem with Newt, send
  611. me mail describing what you had entered, and I'll try to respond asap.
  612.  
  613. Newt Methods
  614. In addition to providing basic coverage of NewtonScript syntax and some
  615. built-in functions, the manual documents more than 40 methods for creating
  616. applications, customizing Newt, drawing with it, and accessing other system
  617. functionality. Description and examples of specific system prototypes are
  618. provided in separate files. I have divided Newt methods into two categories:
  619. Application and General Methods, and Drawing Methods. NewtNewt.txt lists only
  620. several simple drawing methods.
  621.  
  622. :go(distance)
  623. Newt moves distance from current location, forward if distance is positive,
  624. backward if negative. If Pen is a number, Newt draws a line. Newt just clips
  625. the line and disappears if you command it to go outside.
  626.  
  627. :home()
  628. Newt moves to center, heads up, ignoring but preserving current Pen setting.
  629.  
  630. :pendown()
  631. sets Newt's pen down.
  632.  
  633. :penup()
  634. sets Newt's pen up.
  635.  
  636. :poly(sides,len)
  637. Newt draws a polygon, e.g., :poly(6,50) is a hexagon. :poly(times,dist) uses
  638. the edit fields in Newt Controls. A sample source was provided as an example
  639. under Edit Methods (continued).
  640.  
  641. :turn(degrees)
  642. Newt turns degrees relative to current heading: if positive, turns Newt to
  643. right, negative to left.
  644.  
  645. Possible Next Steps
  646. There are many features and fixes that would be nice to have. However, there
  647. are also design trade-offs, especially given the MessagePad's and my
  648. constraints. So, help me figure out:
  649. + where can it go on the screen?
  650. + is it worth the extra memory space or implementation time?
  651. + can it take advantage of existing Newton mechanisms or metaphors?
  652.  
  653. For example:
  654. + resizable views (hooks are in there; need better system support)
  655. + save applications as "real" Newton packages (need docs), access via Extras
  656. + more application protos; palette for app objects with interface support for
  657.   drag, edit, etc.
  658. + online tutorial/help (on Mac as a FrameViewer or DocViewer file; on Newton as
  659.   a book)
  660. + add filing and action buttons (reproduce Notepad functionality)?
  661. + better drag gesture; other gestures for drawing; undo support for drawing?
  662. + use Newt as a wireless remote LegoLogo controller
  663. + allow more customization of Newt environment, save more to Preferences?
  664. + more tutorial information, graphic and application examples?
  665.  
  666. Personal History
  667. I first implemented a screen turtle on an IMLAC display computer, accessed from
  668. BBN Logo on a DEC PDP-10 at Stanford circa 1973. Subsequently, I implemented
  669. other versions in Lisp, and used others in Smalltalk and ObjectLogo. My
  670. long-time interests in children, learning and programming environments, plus
  671. two small NTK examples, Dot2Dot and InspectorGadget, with a little creative
  672. juxtaposition, started me down this path. Experience with using and
  673. implementing object-oriented browsers and toolkits in Smalltalk and Lisp and
  674. numerous user requests led to the Newt 2.0 enhancements to support application
  675. development. When I am not working on Newt at home or trying to have a life, I
  676. am consulting, currently for pharmaceutical companies, on "enabling
  677. technologies", in particular, pen-based systems.
  678.  
  679. Credits
  680. Newt 2.2 was created with NTK 1.0.1. Newton and Newton ToolKit are trademarks
  681. of Apple Computer. Kudos to Apple for creating an exciting product (Newton),
  682. and powerful object-oriented language (NewtonScript) and development
  683. environment (NTK). I look forward to new versions of NTK, documentation and
  684. examples.
  685.  
  686. My family contributed the evening and weekend time for me to explore this;
  687. Ellie and Kristina helped with testing, Maria with proofreading. Finally,
  688. thanks to the early users and beta testers who have given me feedback and
  689. encouragement. I hope that Newt can continue to evolve into an environment
  690. that meets your needs.
  691.